//
//  HZBaseController.swift
//  555wobo
//
//  Created by 黄某某 on 15/12/16.
//  Copyright © 2015年 黄某某. All rights reserved.
//

import UIKit

class HZBaseController: UITableViewController,HZVistorViewDeleage{
    var login = HZUserAccount.userLogin
    override func viewDidLoad() {
        login ? super.viewDidLoad():setupVistorView()
    }
    func setupVistorView(){
        view = vistorView
//        view.backgroundColor = UIColor.whiteColor()
        vistorView.delegate = self
        if self is HZHomeController{
            vistorView.startRotationAnimation()
            
        }else if self is HZMessageController{
            vistorView.setupVistorView("visitordiscover_image_message", message: "登录后，别人评论你的微博，发给你的消息，都会在这里收到通知")
        }else if self is HZDiscoverController{
            vistorView.setupVistorView("visitordiscover_image_message", message: "登录后，最新、最热微博尽在掌握，不再会与实事潮流擦肩而过")
        }else if self is HZProfileController{
            vistorView.setupVistorView("visitordiscover_image_profile", message: "登录后，你的微博、相册、个人资料会显示在这里，展示给别人")
        }
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action: "vistorViewRegister")
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target: self, action: "vistorViewLogin")
        
    }
    lazy var vistorView : HZVistorView = HZVistorView()
    func vistorViewRegister(){
        print(__FUNCTION__)
    }
    func vistorViewLogin() {
        print(__FUNCTION__)
        let oauthVC = HZOauthViewController()
        presentViewController(UINavigationController(rootViewController: oauthVC), animated: true, completion: nil)
        
    }


}
